#ifndef _GYRO_H_
#define _GYRO_H_
#include "maths.h"
struct gyro_device
{
    i16_vector_t adc;
    i16_vector_t offset; // static offset
    fp_vector_t value;   // value dps
    fp_vector_t value_lpf;
    float scale_factor; // adc to value
    int16_t sample_count;
    uint8_t cali_face;
    uint8_t calibrated_axis;
    uint8_t onCaliRgbCnt;
    int16_t x_traceBuffer[64];
    int16_t y_traceBuffer[64];
    int16_t z_traceBuffer[64];

    struct math_variance_i16 variance[3];
    // struct math_variance_i16 y_variance;
    // struct math_variance_i16 z_variance;

    int (*init)(struct gyro_device *dev);
    int (*get_raw_data)(struct gyro_device *gyro);
    int (*update)(struct gyro_device *dev);
};

#endif
